home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / KEYBOARD.SWG / 0051_Clear Keyboard QUICK.pas < prev    next >
Pascal/Delphi Source File  |  1993-10-28  |  570b  |  24 lines

  1. (*==========================================================================
  2. Date: 08-25-93 (00:32)
  3. From: MARC BIR
  4. Subj: CLEAR KEYBOARD
  5.  
  6.   Here's a quick way to clear keyboard buffer:
  7. *)
  8.  
  9. Procedure ClearKeyBoard;
  10. Begin
  11.  ASM CLI End;
  12.  MemW[$40:$1A] := MemW[$40:$1C];
  13.  ASM STI End;
  14. End;
  15.  
  16. (*
  17. MemW[$40:$1A] = ptr to next char in cyclical kbd buffer
  18. MemW[$40:$1C] = ptr to last char ""
  19.  
  20.   Incase you haven't had data structures, when the next ptr equals the
  21. last ptr in a cyclical buufer, the buffer is empty.
  22.   Hope that helps  ( doesn't need CRT )
  23.  
  24.